package com.tsj.mvp.demo7;

import android.content.Context;
import android.util.Log;

/**
 * 专门复制交互（中介，关联view和model）
 * */
public class LoginPresenter7 extends BasePresenter7<LoginView7> {

    public LoginModel7 loginModel;
    public Context context;

    public LoginPresenter7(Context contetxt){
        loginModel = new LoginModel7();
        this.context =contetxt;
    }

    public void login(String username,String password){
        Log.w("Activity","login -------");
        if(getView() != null){
            getView().showLoading(context,"开始登录中...");
            loginModel.login(username, password, new LoginModel7.CallBack() {
                @Override
                public void callback(String result) {
                    Log.w("Activity","result1 -------" + result);
                    getView().onLoginResult(result);
                }
            });
        }

    }

}
